package com.swanclouds.redfish.systems.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.redfish.common.redfish.Status;

import java.util.List;

/**
 *  * Description:
 *  * Author:      zhangliqiang@asiacom.net.cn
 *  * Date:        2022-07-16 12:43.
 *  
 */
public class ProcessorModel  {
    /**指定CPU资源的访问路径**/
    @JsonProperty("@odata.id")
    private String dataId;
    /**指定CPU资源模型的OData描述信息**/
    @JsonProperty("@odata.context")
    private String context;
    /**指定CPU资源的类型**/
    @JsonProperty("@odata.type")
    private String type;
    /**指定CPU在iBMC系统中的唯一标识**/
    @JsonProperty("Id")
    private String id;
    /**指定CPU资源的名称**/
    @JsonProperty("Name")
    private String name;
    /**
     * 指定CPU资源的类型
     * ● CPU
     * ● GPU
     * ● FPGA
     * ● DSP
     * ● Accelerator
     * ● OEM
     */
    @JsonProperty("ProcessorType")
    private String processorType;
    /**
     * 指定
     * ● x86
     * ● IA-64
     * ● ARM
     * ● MIPS
     * ● OEM
     */
    @JsonProperty("ProcessorArchitecture")
    private String processorArchitecture;
    /**
     * 指定CPU资源的指令集
     * ● x86
     * ● x86-64
     * ● IA-64
     * ● ARM-A32
     * ● ARM-A64
     * ● MIPS32
     * ● MIPS64
     * ● OEM
     */
    @JsonProperty("InstructionSet")
    private String instructionSet;
    /**指定CPU资源的制造商**/
    @JsonProperty("Manufacturer")
    private String manufacturer;
    /**指定CPU资源的型号**/
    @JsonProperty("Model")
    private String model;
    /**指定CPU资源的最大主频**/
    @JsonProperty("MaxSpeedMHz")
    private Integer maxSpeedMHz;
    /**指定CPU资源的总核数**/
    @JsonProperty("TotalCores")
    private Integer totalCores;
    /**指定CPU资源的总线程数**/
    @JsonProperty("TotalThreads")
    private Integer totalThreads;
    /**指定CPU资源的插槽号**/
    @JsonProperty("Socket")
    private String socket;
    /**指定CPU资源的序列号**/
    @JsonProperty("ProcessorId")
    private ProcessorId processorInfo;
    /**
     * 指定CPU的状态，包括：
     * ● State：CPU是否被隔离
     * ● Health：CPU健康状态
     * ● Severity：CPU的自定
     * 义健康状态
     */
    @JsonProperty("Status")
    private List<Status> status;
    /**自定义属性**/
    @JsonProperty("Oem")
    private Oem oem;
    /**序列号**/
    @JsonProperty("SerialNumber")
    private String serialNumber;

    @JsonProperty("TDPWatts")
    private String tDPWatts;

	public String getDataId() {
		return this.dataId;
	}

	public void setDataId(String dataId) {
		this.dataId = dataId;
	}

	public String getContext() {
		return this.context;
	}

	public void setContext(String context) {
		this.context = context;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getProcessorType() {
		return this.processorType;
	}

	public void setProcessorType(String processorType) {
		this.processorType = processorType;
	}

	public String getProcessorArchitecture() {
		return this.processorArchitecture;
	}

	public void setProcessorArchitecture(String processorArchitecture) {
		this.processorArchitecture = processorArchitecture;
	}

	public String getInstructionSet() {
		return this.instructionSet;
	}

	public void setInstructionSet(String instructionSet) {
		this.instructionSet = instructionSet;
	}

	public String getManufacturer() {
		return this.manufacturer;
	}

	public void setManufacturer(String manufacturer) {
		this.manufacturer = manufacturer;
	}

	public String getModel() {
		return this.model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public Integer getMaxSpeedMHz() {
		return this.maxSpeedMHz;
	}

	public void setMaxSpeedMHz(Integer maxSpeedMHz) {
		this.maxSpeedMHz = maxSpeedMHz;
	}

	public Integer getTotalCores() {
		return this.totalCores;
	}

	public void setTotalCores(Integer totalCores) {
		this.totalCores = totalCores;
	}

	public Integer getTotalThreads() {
		return this.totalThreads;
	}

	public void setTotalThreads(Integer totalThreads) {
		this.totalThreads = totalThreads;
	}

	public String getSocket() {
		return this.socket;
	}

	public void setSocket(String socket) {
		this.socket = socket;
	}

	public ProcessorId getProcessorInfo() {
		return this.processorInfo;
	}

	public void setProcessorInfo(ProcessorId processorInfo) {
		this.processorInfo = processorInfo;
	}

	public List<Status> getStatus() {
		return this.status;
	}

	public void setStatus(List<Status> status) {
		this.status = status;
	}

	public Oem getOem() {
		return this.oem;
	}

	public void setOem(Oem oem) {
		this.oem = oem;
	}

	public String getSerialNumber() {
		return this.serialNumber;
	}

	public void setSerialNumber(String serialNumber) {
		this.serialNumber = serialNumber;
	}

	public String gettDPWatts() {
		return this.tDPWatts;
	}

	public void settDPWatts(String tDPWatts) {
		this.tDPWatts = tDPWatts;
	}

	public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "ProcessorModel {" +
                "dataId='" + dataId + '\'' +
                ", context='" + context + '\'' +
                ", type='" + type + '\'' +
                ", id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", processorType='" + processorType + '\'' +
                ", processorArchitecture='" + processorArchitecture + '\'' +
                ", instructionSet='" + instructionSet + '\'' +
                ", manufacturer='" + manufacturer + '\'' +
                ", model='" + model + '\'' +
                ", maxSpeedMHz=" + maxSpeedMHz +
                ", totalCores=" + totalCores +
                ", totalThreads=" + totalThreads +
                ", socket='" + socket + '\'' +
                ", processorInfo=" + processorInfo +
                ", status=" + status +
                ", oem=" + oem +
                ", serialNumber='" + serialNumber + '\'' +
                ", tDPWatts='" + tDPWatts + '\'' +
                '}';
    }

    @JsonRootName("ProcessorId")
    public static class ProcessorId {
		/**
		 * CPU 资源的CPUID
		 */
		@JsonProperty("IdentificationRegisters")
    	private String identificationRegisters;
		/**
		 * CPU 资源的系列标识
		 */
		@JsonProperty("EffectiveFamily")
    	private String effectiveFamily;
		/**
		 * CPU 资源的型号标识
		 */
		@JsonProperty("EffectiveModel")
		private String effectiveModel;
		/**
		 * CPU 资源的步进编号
		 */
		@JsonProperty("Step")
		private String step;

		public String getIdentificationRegisters() {
			return this.identificationRegisters;
		}

		public void setIdentificationRegisters(String identificationRegisters) {
			this.identificationRegisters = identificationRegisters;
		}

		public String getEffectiveFamily() {
			return this.effectiveFamily;
		}

		public void setEffectiveFamily(String effectiveFamily) {
			this.effectiveFamily = effectiveFamily;
		}

		public String getEffectiveModel() {
			return this.effectiveModel;
		}

		public void setEffectiveModel(String effectiveModel) {
			this.effectiveModel = effectiveModel;
		}

		public String getStep() {
			return this.step;
		}

		public void setStep(String step) {
			this.step = step;
		}

		
		public String toString() {
			ObjectMapper objectMapper = new ObjectMapper();
			try {
				return objectMapper.writeValueAsString(this);
			} catch (JsonProcessingException e) {
			}
			return "ProcessorId {" +
					"identificationRegisters='" + identificationRegisters + '\'' +
					", effectiveFamily='" + effectiveFamily + '\'' +
					", effectiveModel='" + effectiveModel + '\'' +
					", step='" + step + '\'' +
					'}';
		}
	}

	public static class Oem {

		@JsonProperty("BMC")
		private Bmc bmc;

		@JsonProperty("Huawei")
		private Huawei huawei;

		public Bmc getBmc() {
			return this.bmc;
		}

		public void setBmc(Bmc bmc) {
			this.bmc = bmc;
		}

		public Huawei getHuawei() {
			return this.huawei;
		}

		public void setHuawei(Huawei huawei) {
			this.huawei = huawei;
		}

		@JsonRootName("BMC")
		public static class Bmc {
			/**
			 * 一级缓存
			 */
			@JsonProperty("L1CacheKiB")
			private int l1Cache;
			/**
			 * 二级缓存
			 */
			@JsonProperty("L2CacheKiB")
			private int l2Cache;
			/**
			 * 三级缓存
			 */
			@JsonProperty("L3CacheKiB")
			private int l3Cache;
			/**
			 * CPU资源当前核数
			 */
			@JsonProperty("CurrentCores")
			private int currentCores;
			/**
			 * CPU资源当前线程数
			 */
			@JsonProperty("CurrentThreads")
			private int currentThreads;
			/**
			 * CPU资源的主频
			 */
			@JsonProperty("SpeedMHZ")
			private int speed;
			/**
			 * CPU 资源的基频
			 */
			@JsonProperty("SystemClockSpeedMHz")
			private int systemClockSpeed;
			/**
			 * CPU 资源的S-Spec 编码
			 */
			@JsonProperty("S-Spec")
			private String spec;
			/**
			 * CPU资源的扩展系列
			 */
			@JsonProperty("Ext.Family")
			private String extFamily;
			/**
			 * CPU资源的UPI链路数
			 */
			@JsonProperty("UPILinkNumber")
			private int UPILinkNumber;
			/**
			 * CPU资源的UPI最大链接速率 GTps
			 */
			@JsonProperty("MaxUPILinkTransferRateGTps")
			private double maxUPILinkTransferRate;
			/**
			 * CPU资源的PCIe最大链接速率 GTps
			 */
			@JsonProperty("MaxPCIeLinkTransferRateGTps")
			private int maxPCIeLinkTransferRate;
			/**
			 * CPU资源的推荐工作温度上限
			 */
			@JsonProperty("TcaseCelsius")
			private int tcaseCelsius;
			/**
			 * CPU资源的最大可支持Intel DC Perisisent Memory容量 TiB
			 */
			@JsonProperty("MaxSupportIntelDCPersistentMemorySizeTiB")
			private int MaxSupportIntelDCPersistentMemorySize;
			/**
			 * CPU资源的扩展型号
			 */
			@JsonProperty("Ext.Model")
			private String extModel;
			/**
			 * CPU资源的指令特性
			 */
			@JsonProperty("Features")
			private String features;
			/**
			 * CPU资源的UPI频率 GTps
			 */
			@JsonProperty("UPIFrequencyGTps")
			private double upFrequency;

			public int getL1Cache() {
				return this.l1Cache;
			}

			public void setL1Cache(int l1Cache) {
				this.l1Cache = l1Cache;
			}

			public int getL2Cache() {
				return this.l2Cache;
			}

			public void setL2Cache(int l2Cache) {
				this.l2Cache = l2Cache;
			}

			public int getL3Cache() {
				return this.l3Cache;
			}

			public void setL3Cache(int l3Cache) {
				this.l3Cache = l3Cache;
			}

			public int getCurrentCores() {
				return this.currentCores;
			}

			public void setCurrentCores(int currentCores) {
				this.currentCores = currentCores;
			}

			public int getCurrentThreads() {
				return this.currentThreads;
			}

			public void setCurrentThreads(int currentThreads) {
				this.currentThreads = currentThreads;
			}

			public int getSpeed() {
				return this.speed;
			}

			public void setSpeed(int speed) {
				this.speed = speed;
			}

			public int getSystemClockSpeed() {
				return this.systemClockSpeed;
			}

			public void setSystemClockSpeed(int systemClockSpeed) {
				this.systemClockSpeed = systemClockSpeed;
			}

			public String getSpec() {
				return this.spec;
			}

			public void setSpec(String spec) {
				this.spec = spec;
			}

			public String getExtFamily() {
				return this.extFamily;
			}

			public void setExtFamily(String extFamily) {
				this.extFamily = extFamily;
			}

			public int getUPILinkNumber() {
				return this.UPILinkNumber;
			}

			public void setUPILinkNumber(int UPILinkNumber) {
				this.UPILinkNumber = UPILinkNumber;
			}

			public double getMaxUPILinkTransferRate() {
				return this.maxUPILinkTransferRate;
			}

			public void setMaxUPILinkTransferRate(double maxUPILinkTransferRate) {
				this.maxUPILinkTransferRate = maxUPILinkTransferRate;
			}

			public int getMaxPCIeLinkTransferRate() {
				return this.maxPCIeLinkTransferRate;
			}

			public void setMaxPCIeLinkTransferRate(int maxPCIeLinkTransferRate) {
				this.maxPCIeLinkTransferRate = maxPCIeLinkTransferRate;
			}

			public int getTcaseCelsius() {
				return this.tcaseCelsius;
			}

			public void setTcaseCelsius(int tcaseCelsius) {
				this.tcaseCelsius = tcaseCelsius;
			}

			public int getIsMaxSupportIntelDCPersistentMemorySize() {
				return this.MaxSupportIntelDCPersistentMemorySize;
			}

			public void setIsMaxSupportIntelDCPersistentMemorySize(int MaxSupportIntelDCPersistentMemorySize) {
				this.MaxSupportIntelDCPersistentMemorySize = MaxSupportIntelDCPersistentMemorySize;
			}

			public String getExtModel() {
				return this.extModel;
			}

			public void setExtModel(String extModel) {
				this.extModel = extModel;
			}

			public String getFeatures() {
				return this.features;
			}

			public void setFeatures(String features) {
				this.features = features;
			}

			public double getUpFrequency() {
				return this.upFrequency;
			}

			public void setUpFrequency(double upFrequency) {
				this.upFrequency = upFrequency;
			}
		}
		@JsonRootName("Huawei")
		public static class Huawei {
			/**
			 * 一级缓存
			 */
			@JsonProperty("L1CacheKiB")
			private int l1Cache;
			/**
			 * 二级缓存
			 */
			@JsonProperty("L2CacheKiB")
			private int l2Cache;
			/**
			 * 三级缓存
			 */
			@JsonProperty("L3CacheKiB")
			private int l3Cache;
			/**
			 * 处理器资源的丝印
			 */
			@JsonProperty("DeviceLocator")
			private String deviceLocator;
			private String Position;
			private int Temperature;
			private boolean EnabledSetting;
			private String PartNumber;
			private int FrequencyMHz;
			private String SerialNumber;
			private String FirmwareVersion;
			private int PowerWatts;
			private boolean PowerOn;
			private int AiCoreTempCelsius;
			private int HBMTempCelsius;
			private int NimBusTempCelsius;

			public int getL1Cache() {
				return this.l1Cache;
			}

			public void setL1Cache(int l1Cache) {
				this.l1Cache = l1Cache;
			}

			public int getL2Cache() {
				return this.l2Cache;
			}

			public void setL2Cache(int l2Cache) {
				this.l2Cache = l2Cache;
			}

			public int getL3Cache() {
				return this.l3Cache;
			}

			public void setL3Cache(int l3Cache) {
				this.l3Cache = l3Cache;
			}

			public String getDeviceLocator() {
				return this.deviceLocator;
			}

			public void setDeviceLocator(String deviceLocator) {
				this.deviceLocator = deviceLocator;
			}

			public String getIsPosition() {
				return this.Position;
			}

			public void setIsPosition(String Position) {
				this.Position = Position;
			}

			public int getIsTemperature() {
				return this.Temperature;
			}

			public void setIsTemperature(int Temperature) {
				this.Temperature = Temperature;
			}

			public boolean getIsEnabledSetting() {
				return this.EnabledSetting;
			}

			public void setIsEnabledSetting(boolean EnabledSetting) {
				this.EnabledSetting = EnabledSetting;
			}

			public String getIsPartNumber() {
				return this.PartNumber;
			}

			public void setIsPartNumber(String PartNumber) {
				this.PartNumber = PartNumber;
			}

			public int getIsFrequencyMHz() {
				return this.FrequencyMHz;
			}

			public void setIsFrequencyMHz(int FrequencyMHz) {
				this.FrequencyMHz = FrequencyMHz;
			}

			public String getIsSerialNumber() {
				return this.SerialNumber;
			}

			public void setIsSerialNumber(String SerialNumber) {
				this.SerialNumber = SerialNumber;
			}

			public String getIsFirmwareVersion() {
				return this.FirmwareVersion;
			}

			public void setIsFirmwareVersion(String FirmwareVersion) {
				this.FirmwareVersion = FirmwareVersion;
			}

			public int getIsPowerWatts() {
				return this.PowerWatts;
			}

			public void setIsPowerWatts(int PowerWatts) {
				this.PowerWatts = PowerWatts;
			}

			public boolean getIsPowerOn() {
				return this.PowerOn;
			}

			public void setIsPowerOn(boolean PowerOn) {
				this.PowerOn = PowerOn;
			}

			public int getIsAiCoreTempCelsius() {
				return this.AiCoreTempCelsius;
			}

			public void setIsAiCoreTempCelsius(int AiCoreTempCelsius) {
				this.AiCoreTempCelsius = AiCoreTempCelsius;
			}

			public int getHBMTempCelsius() {
				return this.HBMTempCelsius;
			}

			public void setHBMTempCelsius(int HBMTempCelsius) {
				this.HBMTempCelsius = HBMTempCelsius;
			}

			public int getIsNimBusTempCelsius() {
				return this.NimBusTempCelsius;
			}

			public void setIsNimBusTempCelsius(int NimBusTempCelsius) {
				this.NimBusTempCelsius = NimBusTempCelsius;
			}
		}
	}
}


